home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / games / IndiZone / gold / ghostClass.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  3.1 KB  |  106 lines

  1. /*
  2.  * The original copyright owners of the accompanying source code files have
  3.  * agreed to place such code into the public domain.  Accordingly, anyone
  4.  * who receives or obtains a copy of such source code is freely entitled to
  5.  * reproduce, use and otherwise exploit such code (including the right to
  6.  * make derivative works), at his/her own risk and expense, without any
  7.  * obligation or liability to the original copyright owners.
  8.  *
  9.  * We would appreciate (but do not require) that the following message be
  10.  * included in any derivative works:
  11.  *
  12.  * "Portions of this program were developed by Peter Broadwell, Rob Myers
  13.  * and Robin Schaufler while working in Silicon Valley."
  14.  *
  15.  * The accompanying source code files and related documentation materials
  16.  * are distributed on an "AS IS" basis, without any warranties or
  17.  * guarantees of any kind.  All implied warranties, including the implied
  18.  * warranties of merchantability and of fitness for any particular purpose,
  19.  * are expressly disclaimed.
  20.  */
  21. #include "gl.h"
  22. #include "geom.h"
  23. #include "selectors.h"
  24. #include "class.h"
  25. #include "classIds.h"
  26. #include "mbox.h"
  27. #include "individual.h"
  28. #include "behavior.h"
  29. #include "doers.h"
  30.  
  31. #include "colors.h"
  32.  
  33. extern class indivClass;
  34. model ghostImage;
  35.  
  36. extern char *initGhost();
  37.  
  38. fcnTable ghostTable[] = {
  39.     INIT,    initGhost,    /* instantiate and initialize the model */
  40.     EOTABLE,
  41. };
  42.  
  43. class ghostClass = {
  44.     &indivClass,
  45.     ghostTable,
  46.     sizeof(individual),
  47.     GHOST,
  48. };
  49.  
  50. individual ghostTemplate = {
  51.             /*   inst        */
  52.     &ghostClass,    /* myClass pointer    */
  53.     NULL,        /* classFunctions     */
  54.     0,            /* nFunctions        */
  55.             /*   mailbox        */
  56.     NULL,        /* subscribers          */
  57.     NULL,        /* subscribedTo         */
  58.             /*   individual        */
  59.     {0,0,0},        /* position        */
  60.     {0,0,0},        /* lastPosition        */
  61.     {0,0,0},        /* delta        */
  62.     {0,0,0},        /* velocity        */
  63.     {0,0,0},        /* avelocity        */
  64.     {0,0,0},        /* acceleration        */
  65.     0.0,        /* speed        */
  66.     {0,0,0},        /* heading        */
  67.     {0,0,0},        /* rotation        */
  68.     {0,0,0},        /* influence        */
  69.     1.0,        /* scale                */
  70.     &ghostImage,    /* model        */
  71.     TRUE,        /* flags        */
  72.     NULL,        /* curVars        */
  73. };
  74.  
  75. point ghostImagePoints[] = {
  76.     {    0,    0,    0, },    /* gratuitous vertex 0 */
  77.     {  000,  000,  000, },
  78.     { -300,  000,  400, },
  79.     { -300,  000, -550, },
  80. };
  81.  
  82.         /* null terminated polys, double null at end */
  83. long ghostImageVertices[] = {
  84.     1,2,3,0,
  85.     1,3,2,0,
  86.     0,
  87. };
  88.  
  89. model ghostImage = {
  90.     NULL,            /* next model segment          */
  91.     NULL,            /* child model segments        */
  92.     0,                /* geometry compiled yet?      */
  93.     0,                /* compiled geometry object Id */
  94.     ghostImagePoints,        /* point dictionary            */
  95.     ghostImageVertices,        /* polygon descriptions        */
  96.     { -150,0,-75},        /* centroid                    */
  97.     GHOST_COLOR,        /* color                       */
  98.     GHOST_TEXTURE,        /* texture                     */
  99.     TRUE,            /* outlined                    */
  100.     { 0,0,0},            /* rotation                    */
  101.     { 100,0,-200},            /* translation                 */
  102.     { 1.0,1.0,1.0},        /* scale                       */
  103.     10,                /* declasse               */
  104. };
  105.  
  106.